<?php
class Helper_Time {
	
	public static function out($time) {
		$time = is_numeric($time) ? $time : strtotime($time);
		$alltime = floor((time() - $time) / 60);
		if ($alltime < 60) {
			if ($alltime <= 0) $alltime = 1;
			return $alltime . ' 分钟前';
		} elseif ($alltime < 60 * 24) {
			return floor($alltime / 60) . ' 个月前';
		} elseif ($alltime < 60 * 24 * 30) {
			return floor($alltime / 1440) . ' 天前';
		} else {
			return floor($alltime / 43200) . ' 个月前';
		}
	}

	public static function thumbpath($dateline)
	{
		//if($dateline < 20110220){
		//	return "http://js.vc/io/io/thumb/".$dateline;
		//}else{
			return "http://thumb.pdfio.com/{$dateline}";
		//}
	}
}
